import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default [
  {
    path: '/home',
    name: 'home',
    component: () => import('@/pages/home/Home.vue'),
    redirect: 'home/index.html',
    children: [
      {
        path: 'index.html',
        name: 'index',
        component: () => import('@/pages/home/main/Main.vue'),
        redirect: 'index.html/page.do',
        children: [
          {
            path: 'page.do',
            name: 'page',
            component: () => import('@/pages/home/main/content/MainPage.vue')
          },
          {
            path: 'details.do',
            name: 'messageDetails',
            component: () => import('@/pages/home/main/desc/MessageDesc.vue')
          }
        ],
        query: {
          id: ''
        }
      },
      {
        path: 'brand.html',
        name: 'Brand',
        component: () => import('@/pages/home/brand/BrandPage.vue'),
        children: [
          {
            path: 'details.do',
            name: 'brandDetails',
            component: () => import('@/pages/home/brand/BrandDetails.vue')
          }
        ]
      },
      {
        path: 'enterprise.html',
        name: 'enterprise',
        component: () => import('@/pages/home/enterprise/ListEnterprise.vue')
      },
      {
        path: 'news.html',
        name: 'news',
        component: () => import('@/pages/home/news/NewsDynamic.vue')
      },
      {
        path: 'suggest.html',
        name: 'suggest',
        component: () => import('@/pages/home/suggest/Suggest.vue')
      },
      {
        path: 'about.html',
        name: 'about',
        component: () => import('@/pages/home/about/AboutUs.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/pages/login/Login.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/pages/login/Register.vue')
  },
  {
    path: '/retrieve/password',
    name: 'retrieve',
    component: () => import('@/pages/login/RetrievePassword.vue')
  },
  {
    path: '/personal/center',
    name: 'PersonCenter', // 个人中心
    component: () => import('@/pages/center/PersonalCenter.vue'),
    redirect: '/personal/center/profile/showMeProfile.do',
    children: [
      {
        path: 'profile/showMeProfile.do',
        name: 'MyDesc', // 个人资料
        component: () => import('@/pages/desc/PersonalDesc.vue')
      },
      {
        path: 'profile/resetPws.do',
        name: 'password', // 重置密码
        component: () => import('@/pages/edit/ResetPassWord.vue')
      },
      {
        path: 'profile/editOwnProfile.do',
        name: 'editProfile', // 编辑资料
        component: () => import('@/pages/edit/EditPersonalProfile.vue')
      },
      {
        path: 'profile/setInventory.do',
        name: 'password', // 我的库存
        component: () => import('@/pages/desc/PostDesc.vue')
      },
      {
        path: 'supply/product',
        name: 'supply', // 我的供货
        component: () => import('@/pages/edit/SupplyComponent.vue'),
        query: {
          product: ''
        }
      },
      {
        path: 'brand/uploadBrand.do',
        name: 'uploadBrand', // 上传品牌
        component: () => import('@/pages/center/brand/UploadBrandProfile.vue'),
        query: {
          product: ''
        }
      },
      {
        path: 'brand/other.do',
        name: 'other', // 上传品牌
        component: () => import('@/pages/center/brand/UploadBrandProfile.vue'),
        query: {
          product: ''
        }
      },
      {
        path: 'brand/brandDetails.do',
        name: 'brandDetails', // 品牌详情
        component: () => import('@/pages/center/brand/BrandDetails.vue'),
        query: {
          product: ''
        }
      },
      {
        path: 'company/settle.do',
        name: 'company', // 公司入驻,入驻申请
        component: () => import('@/pages/edit/CompanyComponent.vue')
      },
      {
        path: 'company/details.do',
        name: 'company', // 公司入驻,入驻申请
        component: () => import('@/pages/desc/CompanyDetails.vue')
      }
    ]
  }
]
